#CROSS_COMPILE=/opt/codefidence/bin/mipsel-linux-

# 目标产物:
TARGET = yuvConvert

CC 	            = $(CROSS_COMPILE)gcc
AR              = $(CROSS_COMPILE)ar
AS              = $(CROSS_COMPILE)as
LD              = $(CROSS_COMPILE)ld
CC              = $(CROSS_COMPILE)gcc
CXX             = $(CROSS_COMPILE)g++
CPP             = $(CROSS_COMPILE)cpp
NM              = $(CROSS_COMPILE)nm
STRIP           = $(CROSS_COMPILE)strip
SSTRIP          = $(CROSS_COMPILE)sstrip
OBJCOPY         = $(CROSS_COMPILE)objcopy
OBJDUMP         = $(CROSS_COMPILE)objdump
RANLIB          = $(CROSS_COMPILE)ranlib

#[gcc -l 参数和 -L 参数](https://www.cnblogs.com/benio/archive/2010/10/25/1860394.html)
#   静态库/动态库, 都可以 -l 指定;
#需要链接的库
# LIBVAR = -lsqlite3   #指明需要连接库 libsqlite3.so
# LIBPATH = -L./lib/  #指明需要连接的库的位置;

#header includes (指定编译工程时搜索头文件的目录)
INCLUDES = -I./inc/

#编译规则
CFLAGS = -g -Wall $(INCLUDES)  
OBJS = ./src/main.o ./src/build_time.o ./src/yuvConvert.o
         
#compile and link
$(TARGET) : $(OBJS)
	$(CC)  $(CFLAGS) $^ $(LIBPATH) $(LIBVAR) -ldl -lpthread -o $@   	
clean:
	rm -rf ./*.o  ./src/*.o $(TARGET)


#****************************************************************
# windows 下的 GCC 编译指令
# 1. 使用 sqlite3.dll 动态库(官网下载, win32 版本);
#      gcc -g  -I./inc src/main.c  src/build_time.c  -o trans-clound-music-2---m3u8 ./lib/sqlite3.dll
# 2. 直接将 sqlite.c 编译至代码中;
#      gcc -g  -I./inc -I./sqlite3 sqlite3/sqlite3.c src/main.c  src/build_time.c  -o trans-clound-music-2---m3u8
#****************************************************************

